﻿using System.Windows;
using Microsoft.Windows.Controls.Ribbon;

namespace Brjnk.GpxExplorer
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : RibbonWindow
    {
        private App application;

        public App Application { get { return application; } }

        public MainWindow()
        {
            application = (App)System.Windows.Application.Current;
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
            this.ContentRendered += new System.EventHandler(MainWindow_ContentRendered);
            this.Closed += new System.EventHandler(MainWindow_Closed);
        }

        void MainWindow_Closed(object sender, System.EventArgs e)
        {
            App.Current.Shutdown();
        }

        private void MainWindow_ContentRendered(object sender, System.EventArgs e)
        {
            application.MainWindowContentRendered();
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            application.MainWindowLoaded();
        }
    }
}